package com.cute4j.diffs.cuteswing;

import com.cute4j.swing.Button;
import com.cute4j.swing.events.ActionEvent;
import com.cute4j.swing.events.ActionListener;
import com.cute4j.swingx.MainFrame;

/**
 * Action Listener Example.
 */
public class Cute4jActionListenerExample {

  public static void main(String[] args) {
    MainFrame mainWindow = new MainFrame("Hello World");
    Button button = new Button("Close");
    button.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        System.exit(0);
      }
    });
    mainWindow.add(button); // <-- DIFF+
    mainWindow.pack();
    mainWindow.show(); // <-- DIFF: blocking
  }

}
